/**
 * 
 */
package com.sci.web.action.register;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.dao.UserRegisterDao;

/**
 * @author  BaiFuyou
 * @date: Oct 13, 2011 10:57:22 AM
 * 
 * 检测法人代码是否已经注册过了
 */
public class IsEnterprisecorporatecodeExistEditAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1125815468962428217L;
	
	@Resource
	private UserRegisterDao registerdao;
	/**
	 * 传进的ID
	 */
	private int userid;
	/**
	 * 传进的法人代码
	 */
	private String name;
	/**
	 * @return the userid
	 */
	public int getUserid() {
		return userid;
	}
	/**
	 * @param userid the userid to set
	 */
	public void setUserid(int userid) {
		this.userid = userid;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		super.setContentType(super.JSON);
		if(registerdao.isEnterrprisecorporatecodeExistEdit(userid, name)){
			super.outPrint("ok");
		}else{
			super.outPrint("fail");
		}
		return "json";
	}

}
